package com.x.client.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.x.client.model.ClientRotation;
import com.x.client.rpc.ClientRotationRpcService;
import com.x.framework.controller.BaseController;
import com.x.framework.controller.ResultCode;
import com.x.framework.controller.ResultModel;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping(value = "/clientRotation")
public class ClientRotationController extends BaseController {

	@Reference
	private ClientRotationRpcService clientRotationRpcService;

	/**
	 * 获取C端轮播图列表
	 * @param clientRotation
	 * @return
	 */
	@RequestMapping(value = "/selectClientRotationList", method = {RequestMethod.POST, RequestMethod.GET})
	public ResultModel selectClientRotationList(ClientRotation clientRotation){
		List<ClientRotation> list = clientRotationRpcService.selectRotationList(clientRotation);
		return new ResultModel(ResultCode.RESULT_SUCCESS, "查询成功", list);
	}
}
